package zhu.areas.tenderbid.service;

import java.util.List;

import zhu.areas.tenderbid.dao.ITenderAppDAO;
import zhu.areas.tenderbid.data.TenderApp;

public class TenderAppServiceImpl implements ITenderAppService{

	private  ITenderAppDAO  tenderAppDAO;

	public ITenderAppDAO getTenderAppDAO() {
		return tenderAppDAO;
	}

	public void setTenderAppDAO(ITenderAppDAO tenderAppDAO) {
		this.tenderAppDAO = tenderAppDAO;
	}	
	public List<TenderApp>  getAllTenderApp(){
		return  tenderAppDAO.getAllTenderApp();
	}
	
	public TenderApp  getTenderAppByID(int id){
				TenderApp  tenderApp=(TenderApp) tenderAppDAO.findById(TenderApp.class, id);
//				System.out.println("service  "+tenderApp.getField().getTypeName());
//				tenderApp.getField().setTypeName(tenderApp.getField().getTypeName());  //可用

				return tenderApp;
	}

	public Boolean addTenderApp(TenderApp tenderApp) {
		tenderAppDAO.save(tenderApp);
		return true;
	}

	public Boolean updateTenderApp(TenderApp tenderApp) {
		tenderAppDAO.update(tenderApp);
		return true;
	}

	public Boolean deleteTenderApp(TenderApp tenderApp) {
		tenderAppDAO.delete(tenderApp);
		return true;
	}

	public List<TenderApp> getTenderAppByAuditStatue() {
		// TODO Auto-generated method stub
		return null;
	}

	public List<TenderApp> getTenderAppByFieldType() {
		// TODO Auto-generated method stub
		return null;
	}
	
	
}
